<?php

class Message extends AppModel {
	var $name = 'Message';
	var $belongsTo = array(
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'sender_id'
		),
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'receiver_id'
		)
	);
	
	
	var $validate = array (
		'sender_id' => Array(
			'sender_id_rule_1' => array(
				'rule' => 'notEmpty',
				'message' => 'This field cannot be empty'
			),
			'sender_id_rule_2' => array(
				'rule' => 'numeric',
				'message' => 'This filed must be numeric.'
			)
		),
		'receiver_id' => Array(
			'receiver_id_rule_1' => array(
				'rule' => 'notEmpty',
				'message' => 'This field cannot be empty'
			),
			'receiver_id_rule_2' => array(
				'rule' => 'numeric',
				'message' => 'This filed must be numeric.'
			)
		),
		'subject' => Array(
				'rule' => 'notEmpty',
				'message' => 'The subject cannot be empty'
		),
		'body' => Array(
				'rule' => 'notEmpty',
				'message' => 'The body cannot be empty'
		),
		'created' => Array(
		)
	);
}

?>